package com.summer.dao.provider;

import com.summer.pojo.Provider;

import java.sql.Connection;
import java.util.List;

/**
 * 作者:夏天
 * qq:1205232048
 */
public interface ProviderDao {
    /**
     * 根据连接 供应商 返回添加结果
     * @param connection
     * @param provider
     * @return
     * @throws Exception
     */
    public int add(Connection connection, Provider provider) throws Exception;

    /**
     * 根据连接 供应商名字 供应商编码 返回供应商集合
     * @param connection
     * @param proName
     * @param proCode
     * @return
     * @throws Exception
     */
    public List<Provider> getProviderList(Connection connection, String proName, String proCode) throws Exception;

    /**
     * 根据连接 供应商Id 返回删除结果
     * @param connection
     * @param delId
     * @return
     * @throws Exception
     */
    public int deleteProviderById(Connection connection, String delId) throws Exception;

    /**
     * 根据连接 供应商Id 返回供应商
     * @param connection
     * @param id
     * @return
     * @throws Exception
     */
    public Provider getProviderById(Connection connection, String id) throws Exception;

    /**
     * 根据连接 供应商 返回修改结果
     * @param connection
     * @param provider
     * @return
     * @throws Exception
     */
    public int modify(Connection connection, Provider provider) throws Exception;
}
